<%@page import="java.util.Enumeration"%>
<%@page import="java.util.Date"%>
<%@page import="com.im.dao.CarDAO"%>
<%@page import="com.im.entity.Car"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

	<%
	
		Enumeration<String> enu = application.getInitParameterNames();
		while(enu.hasMoreElements()){
			String param = enu.nextElement();
			String value = application.getInitParameter(param);
			out.print("<h5>Param , ="+param+" = "+value+"</h5>");
		}
	
	
		Object obj = application.getAttribute("server-start");
		if(obj!=null && obj instanceof Date){
			Date date = (Date)obj;
			out.print("<h5>Started="+date+"</h5>");
		}else{
			out.print("<h5>Empty Date</h5>");
		}
	
		//session.setMaxInactiveInterval(10);
		int max = session.getMaxInactiveInterval();
		
		out.print("<h5>Max="+max+"</h5>");
		//Object name = session.getAttribute("name");
		//if(name!=null){
		//	out.println("<h1>Hello Mr. "+name.toString()+"</h1>");
		//}else{
		//	response.sendRedirect("login.jsp");
		//}
	%>


	<%
		List<Car> list = CarDAO.listCars();
		for(Car car : list){
			
			%>
			<h1> <%=car.getTitle() %> </h1>
			<h1> <%=car.getModel() %> </h1>
			<%
			
		}
	%>

</body>
</html>